package jingdong;

import java.util.Scanner;

/**
 * @author Hang
 * @date 2022/8/27
 * @project AutumnOffer
 * @description
 **/
public class Solution1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        String str = sc.next();
        char[] chars = str.toCharArray();
        for(int i=0;i<str.length();i++){
            if(i<n&&(str.charAt(i)<='z'&&str.charAt(i)>='a')){
                chars[i] = (char)(str.charAt(i)+('A'-'a'));
            }else if((str.charAt(i)>='A'&&str.charAt(i)<='Z')&&i>=n){
                chars[i] = (char)(str.charAt(i)+('a'-'A'));
            }
        }
        System.out.println(new String(chars));
    }
}
